Alarm History
The /alarms/history URL provides the ability to retrieve device alarms history, including all alarms raised and cleared by the device since the last reboot.
URL
/api/v1/alarms/history
HTTP Method
GET
Supported Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
?limit=<value> |
Number |
Limits response to a specified number of alarms. Note that the device may return fewer alarms – e.g. if no more alarms exist or if the user-specified number is too large. Default = 20. |
|
?after=<value> |
As returned in previous response |
Returns alarms after the alarm specified by the cursor. The cursor value should be taken from the “cursor” element in the previous response. |
|
?before=<value> |
As returned in previous response. |
Returns alarms before the alarm specified by the cursor (backwards search). The cursor value should be taken from the “cursor” element in the previous response. |
HTTP Responses
| ■ | 200 OK |
| ■ | 204 No Content – when no alarms are found |
Example
| ■ | Request: |
GET /api/v1/alarms/history HTTP/1.1 Host: 10.4.219.229
| ■ | Response: |
HTTP/1.1 200 OK
Content-Type: application/json
{
"alarms": [
{
"id": "1",
"description": "Trunk is down",
"url": "/api/v1/alarms/active/1"
},
{
"id": "2",
"description": "Device will explode in 15 min",
"url": "/api/v1/alarms/active/2"
}
],
"cursor": {
"after": "2",
"before": "-1"
}
}
The 200 OK response includes a “cursor” structure that includes “before” and “after” cursors that may be used in consequent requests. The value “-1” indicates than no more alarms before or after exist.